Database and data stream query

ABSTRACT

Example implementations relate to a database and a data stream query. For example, a computing device may include a processor. The processor may receive a query associated with at least one of a database and a buffer storing streamed data from a data stream, where the database stores database data previously stored in the buffer. The processor may identify at least one postponed command relevant to the query, the at least one postponed command being associated with at least one of the database data and the streamed data. The processor may generate a modified query based on the query and the at least one postponed command, the modified query being a modification of the query to account for the at least one postponed command. The processor may process the modified query and provide a query result of the query based on the modified query being processed.

BACKGROUND

Many entities (e.g., enterprises, organizations, computer applications,etc.) utilize databases for storage of data relating to the entities.The data in a database may be received from a data stream of incomingdata. Data stored in these databases may be accessed and analyzed forvarious purposes.

BRIEF DESCRIPTION OF THE DRAWINGS

Some examples of the present application are described with respect tothe following figures:

FIG. 1 is a block diagram of an example system for processing a databaseand data stream query;

FIG. 2 is a block diagram of a computing device for processing adatabase and data stream query; and

FIG. 3 is a flowchart illustrating an example method of processing adatabase and data stream query.

DETAILED DESCRIPTION

As described above, data stored in a database may be accessed andanalyzed for various purposes. A query of the data in the database mayindicate a particular set of data that is being requested. For example,a user may wish to analyze sales for a particular time range and mayquery the database for this particular set of sales data. However, fordatabases receiving incoming data from a data stream, a query for a setof data from the database alone may produce inaccurate results if thedata in the database is not fresh. For example, the incoming data streammay include and/or specify modifications in the form of raw data and/orcommands, such as updates, insertions, deletions, and the like, to atleast a portion of the database, where those modifications may not bereflected in the results of the query if the database has not yet beenmodified by the data in the data stream.

To more efficiently and accurately run a query associated with adatabase and an incoming data stream that may modify the database data(e.g., insert, delete, and/or update database data), commands that havenot yet been applied to the database and/or the data stream (e.g.,postponed commands, such as insert commands, update commands, and/ordelete commands) may be identified if those commands are relevant to thequery. Postponed commands may be commands, such as insert, update,and/or delete commands, that may be delayed from being executed for anysuitable amount of time (e.g., based on user-specified criteria).Postponing these commands from being executed after they have beenreceived through the data stream may save time and resources, asperforming these commands each time they are received may beinefficient. The identified postponed commands may be given priorityrelative to other commands and may be used to generated a modifiedquery, which may be a modification of the original query modified basedon the relevant commands identified. The modified query may be processedusing a database engine managing the database and/or a data streamengine managing the data stream. The query may be any suitable type ofquery, such as a discrete query, a continuous query, and the like. Adiscrete query may be a query with a fixed, static range delimited bytime or count values. A continuous query may be a query with a series ofranges or windows such that a query result is computed over a particularrange, the range (e.g., its lower and upper bounds) is subsequentlymoved by some specified amount (e.g., a “sliding” window), and the queryis recomputed over the newly defined range, where this process may berepeated until some termination condition is reached. For example, adiscrete query may request data for sales from the previous month. Ifthere are any postponed commands that are associated with data from theprevious month, those commands may be used to generate a modified querythat may be based on the commands and the original query, where theresults to the modified query may be provided in response to theoriginal query. In some examples, these techniques may be performed byan application in communication with and running on top of a data streamengine and a database engine.

The postponed commands that are relevant to the received query may bedetermined and identified in any suitable manner. In some examples, thepostponed commands may be identified based on a range specified in thequery, such as a time range, a range associated with a count of events,and the like. For example, a query may request data associated with atime range that is the previous month, and any postponed commandsassociated with that time range may be identified, prioritized, andaccounted for in a modification to the query that may be processed toprovide results to the query.

While the examples provided herein are described with respect todatabases, one of ordinary skill in the art will recognize that asimilar approach may be used in any suitable context (e.g., Apache™Hadoop®). Additionally, while the examples provided herein are describedwith respect to a single database and a single data stream, one ofordinary skill in the art will recognize that a similar approach may beused for any number of data streams targeting any number of databases,possibly distributed across several compute nodes (e.g.,database-as-a-service). In some examples, the techniques disclosedherein may be capable of querying any suitable execution engine externalto the memory structure (e.g., data stream buffer). For example, datamay be stored in disks (e.g., cold data) and may be modified (e.g., datainserted, deleted, updated, etc.), and the techniques disclosed hereinmay be capable of querying an in-memory structure and/or a disk-basedstorage.

Referring now to the figures, FIG. 1 is a block diagram of an examplesystem 100 for processing a database and data stream query. Data stream102 may include any suitable type of data that may include queries(e.g., a structured query language (SQL) query) specifying a request fora particular set of data that may be stored in database 112 or buffer106, data commands (e.g., insert, delete, and/or update commands), andthe like.

Data stream engine 104 may be a hardware-implemented and/orprocessor-implemented processing engine that may manage and controlreceipt of inserted data from one or more insert commands received fromdata stream 102. Before inserted data from data stream 102 is sent todatabase 112, data stream engine 104 may store the data in buffer 106,which may be any suitable type of storage device. Data stream engine 104may manage and control receipt and processing of queries that may querydata in buffer 106.

Additionally, update and/or delete commands from data stream 102 may bestored in postponed commands module 116, which may be a module and/orstorage device storing commands (e.g., insert commands, update commands,delete commands, etc.) that have not yet been sent to and processed bydata stream engine 104 and/or database engine 110. The postponedcommands may be postponed by query management engine 110 by storing thecommands in postponed commands module 116 based on any suitable criteria(e.g., criteria used to determine which commands to postpone, how longto postpone the commands, etc.). For example, the commands may bepostponed from being processed by data stream engine 104 and/or databaseengine 110 based on user-specified criteria, such as a time criteria,event criteria, and the like. For example, commands may be stored inpostponed command module 116 until a specified amount of time haspassed, until a specified amount of storage has been filled withcommands, and the like.

Database engine 110 may be a hardware-implemented and/orprocessor-implemented processing engine that may manage and controlreceipt and processing of queries that may request data stored indatabase 112, which may be any suitable type of storage device. Databaseengine 110 may also manage and control receipt of data from the datastream and may manage and control storage of the data in database 112.

Query management engine 108 may be a hardware-implemented and/orprocessor-implemented processing engine that may manage and control theprocessing of queries (e.g., discrete or continuous queries), such as aquery from data stream 102. In some examples, query management engine108 may be an application that may be in communication with and externalto data stream engine 104 and database engine 110 such that thefunctions of query management engine 108 may be performed withoutmodification to data stream engine 104 and database engine 110. Querymanagement engine 108 may receive a query from data stream 102 and mayidentify postponed commands in postponed commands module 116 that may berelevant to the query. For example, query management engine 108 maydetermine that a particular set of commands in postponed commands module116 pertains to the query. Query management engine 108 may modify thequery based on the relevant postponed commands to generate a modifiedquery. The modified query may be processed, and the result of themodified query (e.g., query result 114) may be provided in response tothe query.

If a query from data stream 102 is a continuous query, query managementengine 108 may treat the query as an unbounded series of discretequeries that may be called periodically. For example, instead of waitingto update data in the database before computing query result 114, querymanagement engine 108 may maintain the result of the query based on thestored data and incrementally update it based on the data changes in thebuffer, as monitored by query management engine 108. For new records,the aggregated results may be updated on the fly.

In some examples, a query may be a SQL query, and data may reside onpersistent storage in a relation inside a database. A query result tothe query may be calculated despite any changes to data in the databasebased on modifications (e.g., insertions, deletions, updates, etc.) froma data stream. Table 1 below presents an example syntax of queries andoperations that may be used with the techniques disclosed herein:Aggregation Query Insert Delete Update

TABLE 1 Example aggregation query and insert/delete/update operationsAggregation Query Insert Delete Update SELECT G, AGG(A) INSERT DELETEUPDATE R_(u) FROM R_(q) INTO R_(i) FROM R_(d) SET S WHERE P_(q) VALUES VWHERE P_(d) WHERE P_(u) GROUP BY G WINDOW W_(d) WINDOW W_(u) WINDOWW_(q) where A is an attribute name, G is a set of attribute names, V isa set of tuples. AGG ε {min, max, sum, count} is an aggregationfunction, R_(q), R_(i), R_(d), and R_(u) are relations, S is a predicateof the form <attribute name> “=” <constant>, P_(q), P_(d), and P_(u) areconjunctions of atomic predicates, e.g., predicates of the form<attribute name> {“<”|“>”|“=”|“≠”} <constant>, W_(q), W_(d) and W_(u)are windows.

The data stream data relevant to the query may be identified andexecuted before the query is processed using the database. Examplecorrelations between parameters introduced in Table 1 may be considered,and the following classes that may be relevant to the query may beidentified as follows:

-   -   Postpone delete and/or update operation without modifying the        query because the delete and/or update operation, respectively,        does not change the data accessed by the query    -   Postpone delete and/or update operation and conclude that the        query has no results without accessing the data (e.g., all data        relevant for the query is deleted)    -   Postpone delete and/or update operation and modify the query        such that the modified query returns the same results as if        delete and/or update operations, respectively, were performed        prior to query execution        If none of the above applies or does not improve performance, a        delete and/or update operation may be processed before the query        is evaluated.

In some examples, a query relation R_(q) may be compared to a deleteand/or update relation R_(d/u). If R_(q) and R_(d/u), are not the samerelation, the query and delete and/or update operation may not accessthe same data. As such, the delete and/or update operation may bepostponed without affecting the query because the query is not affectedby this data change.

In some examples, a query window W_(q) may be compared to the windowW_(d/u), of a delete and/or update operation. If W_(q) and W_(d/u) donot overlap, the query and delete and/or update operation may not accessthe same data. As such, the delete and/or update operation may bepostponed without affecting the query because the query is not affectedby this data change. The relation between windows may depend on when thequery or the delete and/or update operation was received. In theexamples described in the tables below, it may be assumed that thewindows begin at the same time. If W_(q) and W_(d/u) are of differenttypes (e.g., count-based and time-based), W_(d/u) may be converted tothe type of W_(q) (e.g. 100 relevant tuples within 5 minutes). In theexamples described in the tables below, it may be assumed that W_(q) andW_(d/u) are of the same type (e.g., both count-based, both time-based,etc.).

In some examples, query predicate P_(q) may be compared to the predicateP_(d) of a delete operation, and query window W_(q) may be compared tothe window W_(d) of a delete operation. For example, consider thefollowing query that computes the total price of orders with pricesexceeding $1000 per customer within a day (e.g., 24 hours):

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000

GROUP BY CustomerID

WINDOW Range 1 day

Furthermore, consider the different cases shown in Table 2 below:

TABLE 2 Example correlations between P_(q) and P_(d), and W_(q) andW_(d) Case N^(o) P_(q) vs. P_(d) W_(q) vs. W_(d) Comment Action 1(P_(q) 

 P_(d) ) is not — Query and delete — satisfiable operation does notaccess the same data 2 P_(q) ⊂ P_(d) W_(q) ⊂ W_(d) All tuples relevantfor the The query has query are deleted within no results whole W_(q) 3W_(q) ∩ W_(d) ≠ 0 All tuples relevant for the Modify query and W_(q) isnot ⊂ query are deleted within window W_(d) part of W_(q) (W_(q) −W_(d)) 4 (P_(q) 

 P_(d)) is W_(q) ⊂ W_(d) Some tuples relevant for Modify querysatisfiable and the query are deleted predicate P_(q) is not ⊂ P_(d)within whole W_(q) (P_(q)

 

 P_(d)) 5 W_(q) ∩ W_(d) ≠ 0 Some tuples relevant for Evaluate 2 andW_(q) is not ⊂ the query are deleted queries: First W_(d) within part ofW_(q) with predicate (P_(q)

 

 P_(d)) and window (W_(q) 

 W_(d)), second with predicate P_(q) and window (W_(q) − W_(d)). Combinetheir results

An example of Case 1 in Table 2 above is as follows, which is an exampleoperation to delete all orders with a price smaller than $10 within aday:

DELETE FROM Orders WHERE Price<10 WINDOW Range 1 day

Even though the query and the delete statement above operate on the samerelation within the same period of time, they may never access the sametuples of the relation because the predicates are mutually exclusive. Assuch, this delete operation may be postponed without affecting thequery.

An example of Case 2 in Table 2 above is as follows, which is an exampleoperation to delete all orders with a price greater than $100 within 3days:

DELETE FROM Orders WHERE Price>100 WINDOW Range 3 days

This statement deletes all tuples relevant for the query within thewhole query window. As such, the query may have no results withoutimmediately performing the delete and evaluating the query.

An example of Case 3 in Table 2 above is as follows, which is an exampleoperation to delete all orders with a price greater than $100 dollarswithin 12 hours:

DELETE FROM Orders WHERE Price>100 WINDOW Range 12 hours

This statement deletes all tuples relevant for the query within half ofthe query window. As such, the query window may be modified to disregarddeleted tuples as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000

GROUP BY CustomerID

WINDOW Interval now( )-12 hours, now( )-1 day

An example of Case 4 in Table 2 above is as follows, which is an exampleoperation to delete all orders with CustomerID1 and a price greater than$100 within 3 days:

DELETE FROM Orders WHERE CustomerID=1 AND Price>100 WINDOW Range 3 days

This delete statement deletes some tuples relevant for the query (e.g.,those with CustomerID 1) within the whole query window. As such, thequery predicates may be modified to disregard deleted tuples as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000 AND CustomerID!=1

GROUP BY CustomerID

WINDOW Range 1 day

An example of Case 5 in Table 2 above is as follows, which is an exampleoperation to delete all orders with CustomerID 1 and price greater than$100 within 12 hours:

DELETE FROM Orders WHERE CustomerID=1 AND Price>100 WINDOW Range 12hours

This statement deletes some tuples relevant for the query (e.g., thosewith CustomerID 1) within half of the query window. As such, a query maybe evaluated with the same predicates on the time interval, which is notaffected by the delete operation, as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000

GROUP BY CustomerID

WINDOW Interval now( )-12 hours, now( )-1 day

In addition, the query predicates may be modified to disregard deletedtuples within the time interval, which is affected by the deleteoperation, as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000 AND CustomerID!=1

GROUP BY CustomerID

WINDOW Range 12 hours

The results of these two operations may be combined to arrive at thequery result of the original query.

Referring back to Table 1, in some examples, query predicate P_(q),GROUP BY clause G, and aggregate attribute A may be compared to thepredicate P_(u) and SET clause S of an update operation. Additionally,query window W_(q) may be compared to the window W_(u) of an updateoperation. These examples may be explained with respect to Table 3below:

TABLE 3 Example correlations between P_(q), G, A vs. P_(u), S and W_(q)vs. W_(u) Case N^(o) P_(q), G, A vs, P_(u), S W_(q) vs. W_(u) CommentAction 1 S sets no — Query and update — attributes operation does notaccessed by P_(q), access the same data G, A 2 (P_(q) 

 P_(u)) is not satisfiable and no tuple with the same attribute valuesas S can satisfy P_(q) 3 P_(q) ⊂ P_(u) and no W_(q) ⊂ W_(u) All tuplesrelevant for The query has no tuple with the the query become resultssame attribute irrelevant within whole values as S can W_(q) 4 satisfyP_(q) W_(q) ∩ W_(u) ≠ 0 All tuples relevant for Modify query and W_(q)is not the query become window ⊂ W_(u) irrelevant within part of (W_(q)− W_(u)) W_(q) 5 (P_(q)  

 P_(u)) is W_(q) ⊂ W_(u) Some tuples become Modify query satisfiable,irrelevant for the query predicate P_(q) is not ⊂ P_(u), and withinwhole W_(q) (P_(q)  

 

 P_(u)) 6 no tuple with the W_(q) ∩ W_(u) ≠ 0 Some tuples becomeEvaluate 2 queries: same attribute and W_(q) is not irrelevant for thequery First with predicate values as S can ⊂W_(u) within part of W_(q)(P_(q) 

 

 P_(u)) and satisfy P_(q) window (W_(q) 

 W_(u)), second with predicate P_(q) and window (W_(q) − W_(u)). Combinetheir results.

An example of Case 1 in Table 3 above is as follows, which is an exampleupdate operation to set the quantity attribute of all orders withCustomerID=1 within a day:

UPDATE Orders SET Quantity=3 WHERE CustomerID=1 WINDOW Range 1 day

Even though the query and the update statement above may access the sametuples, the changes of the update operation are irrelevant for thequery. As such, the update operation may be postponed without affectingthe query.

An example of Case 2 in Table 3 above is as follows, which is an exampleupdate operation to set the price attribute to $10 for all orders with aprice less than $10 within a day:

UPDATE Orders SET Price=10 WHERE Price<10 WINDOW Range 1 day

Even though the query and the update statement above may operate on thesame relation within the same period of time, they may not access thesame tuples of the relation because the predicates are mutuallyexclusive. Furthermore, the tuples changed by the update operationremain irrelevant for the query. As such, the update operation may bepostponed without affecting the query.

An example of Case 3 in Table 3 above is as follows, which is an exampleupdate operation to set the price attribute to $10 for all orders with aprice greater than $100 within 3 days:

UPDATE Orders SET Price=10 WHERE Price>100 Window Range 3 days

This statement makes all tuples that were relevant for the queryirrelevant within the whole query window. As such, it may be concludedthat the query has no results without immediately performing the updateand evaluating the query.

An example of Case 4 in Table 3 above is as follows, which is an exampleupdate operation to set the price attribute to $10 for all orders with aprice greater than $100 within 12 hours:

UPDATE Orders SET Price=10 WHERE Price>100 WINDOW Range 12 hours

This statement makes all tuples that were relevant for the queryirrelevant within half of the query window. As such, the query windowmay be modified to disregard the updated tuples as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000

GROUP BY CustomerID

WINDOW Interval now( )-12 hours, now( )-1 day

An example of Case 5 in Table 3 above is as follows, which is an exampleupdate operation to set the price attribute to $10 for all orders with aprice greater than $1100 within 3 days:

UPDATE Orders SET Price=10 WHERE Price>1100 WINDOW Range 3 days

This statement makes some tuples (e.g., those with a price greater than$1100) that were relevant for the query irrelevant within the wholequery window. As such, the query predicates may be modified to disregardupdated tuples as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000 AND Price<=1100

GROUP BY CustomerID

WINDOW Range 1 day

An example of Case 6 in Table 3 above is as follows, which is an exampleupdate operation to set the price attribute to $10 for all orders with aprice greater than $1100 within 12 hours:

UPDATE Orders SET Price=10 WHERE Price>1100 WINDOW Range 12 hours

This statement makes some tuples (e.g., those with a price greater than$1100) that were relevant for the query irrelevant within half of thequery window. As such, a query may be evaluated with the same predicateson the time interval, which is not affected by the update, as follows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000

GROUP BY CustomerID

WINDOW Interval now( )-12 hours, now( )-1 day

Additionally, the query predicates may be modified to disregard updatedtuples within the time interval, which is not affected by the update, asfollows:

SELECT CustomerID, SUM(Price)

FROM Orders

WHERE Price>1000 AND Price<=1100

GROUP BY CustomerID

WINDOW Range 12 hours

The results of these two operations may be combined to arrive at thequery result of the original query.

In contrast to Table 2, Table 3 does not present all of the possiblecases. In some examples, in other cases not presented in Table 3, anupdate statement may be performed before the query may be evaluated. Forexample:

UPDATE Orders SET Price=1001 WHERE Price=1000 Window Range 12 hours

UPDATE Orders SET CustomerID=1 WHERE CustomerID=2 Window Range 12 hours

In some examples, when there are multiple data change actions, such asmultiple update operations, these multiple statements may be optimized.For example, statements may be optimized by merging consecutivemodification operations over a relation. For example, consider thefollowing two consecutive updates:

UPDATE R Set status=gold where income>500000

UPDATE R Set status=gold where income>400000

The second statement subsumes the first statement, so the first updatemay be ignored when evaluating queries. In some examples, a similar caseanalysis may be applied to pending updates to reduce the amount of workto be performed when evaluating queries against the full data stream ofall changes in the buffer.

FIG. 2 is a block diagram of an example computing device 200 forprocessing a database and data stream query 214. The query 214 may beprocessed by identifying postponed commands relevant to query 214 andmodifying query 214 based on the postponed commands.

Computing device 200 may be, for example, a web-based server, a localarea network server, a cloud-based server, a notebook computer, adesktop computer, an all-in-one system, a tablet computing device, amobile phone, an electronic book reader, a printing device, or any otherelectronic device suitable for processing a query (e.g., query 214) of adatabase and a data stream. Computing device 200 may include a processor202 and a machine-readable storage medium 204. Computing device 200 mayidentify postponed commands relevant to query 214, generate a modifiedquery based on the postponed commands, and process the modified query toproduce query result 216.

Processor 202 is a tangible hardware component that may be a centralprocessing unit (CPU), a semiconductor-based microprocessor, and/orother hardware devices suitable for retrieval and execution ofinstructions stored in machine-readable storage medium 204. Processor202 may fetch, decode, and execute instructions 206, 208, 210, and 212to control a process of processing a query of a database and a datastream. As an alternative or in addition to retrieving and executinginstructions, processor 202 may include at least one electronic circuitthat includes electronic components for performing the functionality ofinstructions 206, 208, 210, 212, or a combination thereof.

Machine-readable storage medium 204 may be any electronic, magnetic,optical, or other physical storage device that contains or storesexecutable instructions. Thus, machine-readable storage medium 204 maybe, for example, Random Access Memory (RAM), an Electrically ErasableProgrammable Read-Only Memory (EEPROM), a storage device, an opticaldisc, and the like. In some examples, machine-readable storage medium204 may be a non-transitory storage medium, where the term“non-transitory” does not encompass transitory propagating signals. Asdescribed in detail below, machine-readable storage medium 204 may beencoded with a series of processor executable instructions 206, 208,210, and 212 for receiving a query (e.g., query 214) associated with atleast one of a database and a buffer storing streamed data from a datastream, the database storing database data previously stored in thebuffer; identifying at least one postponed command received from thedata stream and being relevant to the query, the at least one postponedcommand being delayed from execution and being associated with at leastone of the database data and the streamed data; generating a modifiedquery based on the query and the at least one postponed command, wherethe modified query is a modification of the query to account for the atleast one postponed command; processing the modified query; andproviding a query result of the query based on the modified query beingprocessed.

Query receipt instructions 206 may manage and control receipt ofqueries, such as query 214. Query 214 may indicate a particular set ofdata being requested with respect to at least one of a database of dataand/or a data stream of data that may update the database. Data from thedata stream may be stored in a buffer before being sent to the database.For example, query receipt instructions 206 may manage and controlreceipt of query 214 requested from a user.

Postponed command identification instructions 208 may manage and controlthe identification and/or determination of postponed commands that maybe associated with the received query. For example, commands that may bepostponed (e.g., not yet applied to the database data or the data streamdata) may be identified if the commands are relevant to query 214. Thepostponed commands may be relevant to the query if the commands may beapplied to data requested by the query. For example, postponed commandsmay be relevant to query 214 if the commands are associated with a rangespecified by query 214 (e.g., count range, time range, etc.).

Modified query generation instructions 210 may manage and control thegeneration of a modified query that may be a modification of the queryto account for the postponed commands relevant to the query. Forexample, a modified query may be generated by modifying query 214 toaccount for relevant postponed commands. In some examples, the modifiedquery may include a sub-query relevant to and processed using thedatabase and a sub-query relevant to and processed using the data streamdata.

Query result processing instructions 212 may manage and control theprocessing of the modified query to generate query result 216 and mayprovide query result 216 in response to query 214. For example, queryresult processing instructions 212 may process the modified query andmay return results (e.g., query result 216) based on the modified querybeing processed. In examples in which the modified query includes asub-query relevant to and processed using the database and a sub-queryrelevant to and processed using the data stream data, the sub-queriesmay be processed and the results may be combined to produce query result216.

FIG. 3 is a flowchart illustrating an example method 300 of processing adatabase and data stream query. Method 300 may be implemented usingcomputing device 200 of FIG. 2.

Method 300 includes, at 302, receiving a query associated with at leastone of a database and a buffer storing streamed data from a data stream,the database storing database data previously stored in the buffer. Thequery received may be any type of query specifying a request for datawith respect to the database and/or the data stream.

Method 300 also includes, at 304, determining at least one postponedcommand relevant to the query, the at least one postponed command beingassociated with at least one of the database data and the streamed data.For example, any postponed commands that may be relevant to the querymay be determined and identified.

Method 300 also includes, at 306, creating a modified query based on thequery and the at least one postponed command, the modified query being amodification of the query to account for the at least one postponedcommand. For example, a modified query may be created by accounting forthe at least one postponed command identified.

Method 300 also includes, at 308, processing the modified query. Forexample, the modified query may be processed using the database dataand/or the data stream data.

Method 300 also includes, at 310, providing a query result of the querybased on the modified query being processed. For example, the results ofthe modified query may be provided. In some examples, if the modifiedquery includes a sub-query relevant to and processed using the databaseand a sub-query relevant to and processed using the data stream data,the results of the sub-queries may be combined and provided as the queryresult.

Examples provided herein (e.g., methods) may be implemented in hardware,software, or a combination of both. Example systems may include acontroller/processor and memory resources for executing instructionsstored in a tangible non-transitory medium (e.g., volatile memory,non-volatile memory, and/or machine-readable media). Non-transitorymachine-readable media can be tangible and have machine-readableinstructions stored thereon that are executable by a processor toimplement examples according to the present disclosure.

An example system can include and/or receive a tangible non-transitorymachine-readable medium storing a set of machine-readable instructions(e.g., software). As used herein, the controller/processor can includeone or a plurality of processors such as in a parallel processingsystem. The memory can include memory addressable by the processor forexecution of machine-readable instructions. The machine-readable mediumcan include volatile and/or non-volatile memory such as a random accessmemory (“RAM”), magnetic memory such as a hard disk, floppy disk, and/ortape memory, a solid state drive (“SSD”), flash memory, phase changememory, and the like.

What is claimed is:
 1. A computing device comprising: a processor to:receive a query associated with at least one of a database and a bufferstoring streamed data from a data stream, the database storing databasedata previously stored in the buffer; identify at least one postponedcommand received from the data stream and being relevant to the query,the at least one postponed command being delayed from execution andbeing associated with at least one of the database data and the streameddata; generate a modified query based on the query and the at least onepostponed command, the modified query being a modification of the queryto account for the at least one postponed command; process the modifiedquery; and provide a query result of the query based on the modifiedquery being processed.
 2. The computing device of claim 1, wherein theat least one postponed command is identified based on a range specifiedin the query.
 3. The computing device of claim 2, wherein the range isat least one of a time range and a count range.
 4. The computing deviceof claim 1, wherein the at least one postponed command includes at leastone of an update command and a delete command.
 5. The computing deviceof claim 1, wherein the modified query includes a database sub-query anda data stream sub-query, the database sub-query being processed based onthe database and the at least one postponed command to generate adatabase sub-query result, the data stream sub-query being processedbased on the data stream and the at least one postponed command togenerate a data stream sub-query result, the query result being acombination of the database sub-query result and the data streamsub-query result.
 6. The computing device of claim 1, wherein the atleast one postponed command is postponed based on user-specifiedcriteria.
 7. A method comprising: receiving, by a computing device, aquery associated with at least one of a database and a buffer storingstreamed data from a data stream, the database storing database datapreviously stored in the buffer; determining, by the computing device,at least one postponed command relevant to the query, the at least onepostponed command being associated with at least one of the databasedata and the streamed data; creating, by the computing device, amodified query based on the query and the at least one postponedcommand, the modified query being a modification of the query to accountfor the at least one postponed command; processing, by the computingdevice, the modified query; and returning, by the computing device, aquery result of the query based on the modified query being processed.8. The method of claim 7, wherein the at least one postponed commandincludes at least one of an update command and a delete command.
 9. Themethod of claim 7, wherein the modified query includes a databasesub-query and a data stream sub-query, the database sub-query beingprocessed based on the database and the at least one postponed commandto generate a database sub-query result, the data stream sub-query beingprocessed based on the data stream and the at least one postponedcommand to generate a data stream sub-query result, the query resultbeing a combination of the database sub-query result and the data streamsub-query result.
 10. The method of claim 7, wherein the at least onepostponed command is postponed based on user-specified criteria.
 11. Anon-transitory machine-readable storage medium storing instructionsthat, if executed by at least one processor of a computing device, causethe computing device to: receive a query associated with at least one ofa database and a buffer storing streamed data from a data stream, thedatabase storing database data previously stored in the buffer; identifyat least one postponed command relevant to the query, the at least onepostponed command being associated with at least one of the databasedata and the streamed data; generate a database sub-query and a datastream sub-query each based on the query and the at least one postponedcommand; process the database sub-query and the data stream sub-query;and provide a query result of the query, the query result being acombination of a database sub-query result of the database sub-query anda data stream sub-query result of the data stream sub-query.
 12. Thenon-transitory machine-readable storage medium of claim 11, wherein theat least one postponed command is identified based on a range specifiedin the query.
 13. The non-transitory machine-readable storage medium ofclaim 12, wherein the range is at least one of a time range and a countrange.
 14. The non-transitory machine-readable storage medium of claim11, wherein the at least one postponed command includes at least one ofan update command and a delete command.
 15. The non-transitorymachine-readable storage medium of claim 11, wherein the at least onepostponed command is postponed based on user-specified criteria.